package com.anze.abd.persistence.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 产品实体类
 * @author hejun
 *
 */
@Entity
@Table(name="PRODUCT")
public class Product implements Serializable{
	
	private static final long serialVersionUID = -5693714397066430449L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID")
	private Long id;
	
	/**
	 * 直通车名称
	 */
	@Column(name = "NAME")
	private String name;
	
	/**
	 * 运营
	 */
	@Column(name = "OPERATION")
	private boolean operation;
	
	/**
	 * 目的地
	 */
	@Column(name = "DESTINATION")
	private String destination;
	
	/**
	 * 一对多级联保存、更新、删除、刷新;延迟加载
	 * referencedColumnName强制表名，不写就等于name
	 */
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@JoinTable(name="product_stroke",
			joinColumns={@JoinColumn(name="PRODUCT_ID",referencedColumnName="ID")},
			inverseJoinColumns={@JoinColumn(name="STROKE_ID",referencedColumnName="ID")}
	)
	private List<Stroke> strokes;
	
	/**
	 * 车辆要求
	 */
	@Column(name = "REQUIR")
	private int requir;
	
	/**
	 * 乘客
	 */
	@Column(name = "PASSENGER")
	private int passenger;
	
	/**
	 * 运营时间
	 */
	@Column(name = "OPENING1")
	private String opening1;
	
	@Column(name = "OPENING2")
	private String opening2;
	/**
	 * 有效时间
	 */
	@Column(name = "VALID1")
	private String valid1;
	
	@Column(name = "VALID2")
	private String valid2;
	/**
	 * banner图
	 */
	@Column(name = "BANNER_IMG",nullable=true)
	private String bannerImg;
	
	/**
	 * 产品简介
	 */
	@Column(name = "INTRODUCE",nullable=true)
	private String introduce;
	
	/**
	 * 行程安排
	 */
	@Column(name = "SCHEDULE",columnDefinition="text",nullable=true) 
	private String schedule;
	
	/**
	 * 图文介绍
	 */
	@Column(name = "INTRODUCTION",columnDefinition="text",nullable=true) 
	private String introduction;
	
	/**
	 * 费用包含
	 */
	@Column(name = "COST_INCLUDED",columnDefinition="text",nullable=true) 
	private String costIncluded;//费用包含
	
	/**
	 * 费用不包含
	 */
	@Column(name = "NOT_INCLUDED",columnDefinition="text",nullable=true) 
	private String notIncluded;
	
	/**
	 * 改退规则
	 */
	@Column(name = "CHANGE_RULE",columnDefinition="text",nullable=true) 
	private String changeRule;
	
	/**
	 * 预定须知
	 */
	@Column(name = "BOOKING_NOTICE",columnDefinition="text",nullable=true) 
	private String bookingNotice;
	
	/**
	 * 分享标题
	 */
	@Column(name ="SHARE",nullable=true)
	private String share;
	
	/**
	 * 分享banner图
	 */
	@Column(name = "SHARE_IMG",nullable=true)
	private String shareImg;
	
	/**
	 * 以后均为get,set方法
	 * @return
	 */
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isOperation() {
		return operation;
	}
	public void setOperation(boolean operation) {
		this.operation = operation;
	}
	public String getDestination() {
		return destination;
	}
	public void setDestination(String destination) {
		this.destination = destination;
	}
	public List<Stroke> getStrokes() {
		return strokes;
	}
	public void setStrokes(List<Stroke> strokes) {
		this.strokes = strokes;
	}
	public int getRequir() {
		return requir;
	}
	public void setRequir(int requir) {
		this.requir = requir;
	}
	public int getPassenger() {
		return passenger;
	}
	public void setPassenger(int passenger) {
		this.passenger = passenger;
	}
	public String getOpening1() {
		return opening1;
	}
	public void setOpening1(String opening1) {
		this.opening1 = opening1;
	}
	public String getOpening2() {
		return opening2;
	}
	public void setOpening2(String opening2) {
		this.opening2 = opening2;
	}
	public String getValid1() {
		return valid1;
	}
	public void setValid1(String valid1) {
		this.valid1 = valid1;
	}
	public String getValid2() {
		return valid2;
	}
	public void setValid2(String valid2) {
		this.valid2 = valid2;
	}
	public String getBannerImg() {
		return bannerImg;
	}
	public void setBannerImg(String bannerImg) {
		this.bannerImg = bannerImg;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public String getSchedule() {
		return schedule;
	}
	public void setSchedule(String schedule) {
		this.schedule = schedule;
	}
	public String getIntroduction() {
		return introduction;
	}
	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	public String getCostIncluded() {
		return costIncluded;
	}
	public void setCostIncluded(String costIncluded) {
		this.costIncluded = costIncluded;
	}
	public String getNotIncluded() {
		return notIncluded;
	}
	public void setNotIncluded(String notIncluded) {
		this.notIncluded = notIncluded;
	}
	public String getChangeRule() {
		return changeRule;
	}
	public void setChangeRule(String changeRule) {
		this.changeRule = changeRule;
	}
	public String getBookingNotice() {
		return bookingNotice;
	}
	public void setBookingNotice(String bookingNotice) {
		this.bookingNotice = bookingNotice;
	}
	public String getShare() {
		return share;
	}
	public void setShare(String share) {
		this.share = share;
	}
	public String getShareImg() {
		return shareImg;
	}
	public void setShareImg(String shareImg) {
		this.shareImg = shareImg;
	}
	
	
	
	
}
